import { request } from "@/utils/service"

// 发票主表列表
export function getInvoiceListApi(data: any) {
  return request<any>({
    url: "/ocean-wms/wmsInvoice/findList",
    method: "post",
    data
  })
}

// 发票明细列表
export function getInvoiceDetListApi(data: any) {
  return request<any>({
    url: "/ocean-wms/wmsInvoiceDet/findList",
    method: "post",
    data
  })
}

// 线上订单发票列表
export function getOnlineSaleInvoiceListApi(data: any) {
  return request<any>({
    url: "/ocean-wms/wmsOnlineSaleInvoice/findList",
    method: "post",
    data
  })
}

// 手动反写
export function rewriteOnlineSaleInvoiceApi(params: any) {
  return request<any>({
    url: "/ocean-wms/wmsOnlineSaleInvoice/rewrite",
    method: "post",
    params
  })
}

// 清除回传记录
export function cleanRewriteRecordApi(params: any) {
  return request<any>({
    url: "/ocean-wms/wmsOnlineSaleInvoice/cleanRewriteRecord",
    method: "post",
    params
  })
}

// 清除回传记录
export function manualConfirmApi(params: any) {
  return request<any>({
    url: "/ocean-wms/wmsOnlineSaleInvoice/manualConfirm",
    method: "post",
    params
  })
}

// 根据线上单号同步发票
export function syncInvoiceBySoIdApi(soIdList: any) {
  return request<any>({
    url: "/ocean-wms/qimenapi/syncInvoiceBySoId",
    method: "post",
    data: soIdList // 将参数直接传递给后端
  })
}

// 根据线上单号同步发票
export function syncInvoiceByDateApi(data: any) {
  return request<any>({
    url: "/ocean-wms/wmsOnlineSaleInvoice/syncInvoiceByDate",
    method: "post",
    data
  })
}

// 获取自动回传配置
export function getAutoRewriteConfigApi() {
  return request<any>({
    url: "/ocean-wms/wmsOnlineSaleInvoice/getAutoRewriteConfig",
    method: "post"
  })
}

// 保存自动回传配置
export function saveAutoRewriteConfigApi(data: any) {
  return request<any>({
    url: "/ocean-wms/wmsOnlineSaleInvoice/saveAutoRewriteConfig",
    method: "post",
    data
  })
}

// 线上订单发票列表
export function getAutoRewriteInvoiceListApi(data: any) {
  return request<any>({
    url: "/ocean-wms/wmsOnlineSaleInvoice/getAutoRewriteInvoiceList",
    method: "post",
    data
  })
}

// 出库单明细
export function getWaitInvoicingWarehouseListApi(data: any) {
  return request<any>({
    url: "/ocean-wms/wmsOutWarehouseOrderDet/waitInvoicingWarehouseList",
    method: "post",
    data
  })
}

// 0元订单明细
export function findZeroDetListApi(params: any) {
  return request<any>({
    url: "/ocean-wms/wmsOnlineSaleInvoice/findZeroDetList",
    method: "post",
    params
  })
}

// 0元订单明细
export function deleteZeroApi(params: any) {
  return request<any>({
    url: "/ocean-wms/wmsOnlineSaleInvoice/deleteZero",
    method: "post",
    params
  })
}
